package com.microstation.spring.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan(basePackages = "com.microstation.*")
@MapperScan(basePackages = {"com.microstation.dao.view", "com.microstation.dao"})
@ServletComponentScan(basePackages = {"com.microstation"})
public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //设置启动类，用于独立tomcat运行的入口
        return builder.sources(Application.class);
    }
}
